<extend name = "default/base" />
<block name='link'><include file='default/link' /></block>
<block name="header">
	<include file='default/header' />
</block>
<block name="left">
	<include file='default/left' />
</block>

<block name='main'>

<div class="main-content" >
<!-- page heading start-->
        <div class="page-heading">
           <!--  <h3>
                Basic Table
            </h3> -->
            <ul class="breadcrumb">
                <li>
                    <a href="#">{$line}</a>
                </li>
                <li>
                    <a href="#">{$line_name}</a>
                </li>
            </ul>
        </div>
        <!-- page heading end-->
	<div class="row">
        <div class="col-sm-12">
            <section class="panel">
                <div class="panel">

        <!--body wrapper start-->
        <div class="wrapper">
             <div class="row">
                <div class="col-sm-12">
                <section class="panel">
                <header class="panel-heading">
                    用户列表
                    <span class="tools pull-right">
                        <a href="javascript:;" class="fa fa-chevron-down"></a>
                        <a href="javascript:;" class="fa fa-times"></a>
                     </span>
                </header>
                <div class="panel-body">
                <div class="adv-table editable-table ">
                <div class="clearfix">
                    <div class="btn-group">
                        <button class="btn btn-primary">
                            <a href="{:U('User/add')}">增加用户</a> <i class="fa fa-plus"></i>
                        </button>
                    </div>
                </div>
                <div class="space15"></div>
                <table class="table table-striped table-hover table-bordered" id="editable-sample">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>用户名</th>
                    <th>用户密码</th>
                    <th>用户昵称</th> 
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                    <volist name='list' id='vo'>
                            <tr>
                                <td>{$vo.id}</td>
                                <td ><a href="#">{$vo.username}</a></td>
                                <td>{$vo.password}</td>
                                <td>{$vo.nickname}</td>
                               <td>
                                <switch name="vo.status">
                                    <case value='1'>
                                    <span class="label label-success label-mini">激活</span>
                                    </case>
                                    </case>
                                    <case value='0'>
                                    <span class="label label-danger label-mini">未激活</span>
                                    </case>
                                    <default />default
                                </switch>
                               </td>
                               <td>
                               <button class='u_del'><a href="{:U('User/del')}">删除</a></button>
                               <a href=''>权限管理</a>
                               </td>
                    </volist>
                </tr>
                
                
                </tbody>
                </table>
                </div>
                </div>
                </section>
                </div>
                </div>
        </div>
		</div>
</block>
<block name='footer'>
		<!-- Placed js at the end of the document so the pages load faster -->
		<script src="__PUBLIC__/admin/js/jquery-1.10.2.min.js"></script>
		<script src="__PUBLIC__/admin/js/jquery-ui-1.9.2.custom.min.js"></script>
		<script src="__PUBLIC__/admin/js/jquery-migrate-1.2.1.min.js"></script>
		<script src="__PUBLIC__/admin/js/bootstrap.min.js"></script>
		<script src="__PUBLIC__/admin/js/modernizr.min.js"></script>
		<script src="__PUBLIC__/admin/js/jquery.nicescroll.js"></script>
        <!-- Placed js at the end of the document so the pages load faster -->
<!-- <script src="js/jquery-1.10.2.min.js"></script> -->
<!-- <script src="js/jquery-ui-1.9.2.custom.min.js"></script> -->
<!-- <script src="js/jquery-migrate-1.2.1.min.js"></script> -->
<!-- <script src="js/bootstrap.min.js"></script> -->
<!-- <script src="js/modernizr.min.js"></script> -->
<!-- <script src="js/jquery.nicescroll.js"></script> -->

<!--data table-->
<script type="text/javascript" src="__PUBLIC__/admin/js/data-tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="__PUBLIC__/admin/js/data-tables/DT_bootstrap.js"></script>



<!--script for editable table-->
<script src="__PUBLIC__/admin/js/editable-table.js"></script>

<!-- END JAVASCRIPTS -->
<script>
    jQuery(document).ready(function() {
        EditableTable.init();
    });
</script>
		<!--common scripts for all pages-->
		<script src="__PUBLIC__/admin/js/scripts.js"></script>
<script>
     $(function(){
            $('.u_del').click(function(){
               $this = this;
               id = $this.parentElement.parentElement.cells[0].innerHTML;

               $.ajax({
                type:'get',
                url:"__CONTROLLER__/del/id/"+id,
                success:function(data){ 
                 if(data == '成功'){
                    index=$this.parentElement.parentElement.rowIndex;
                    $this.parentElement.parentElement.parentElement.deleteRow(index-1);
                 }
            
                },
                error:function(){
                     alert('操作失败,失败！');
                },
            });
        })
    })
    </script>

	 <!--footer section start-->
        <footer>
            2014 &copy; AdminEx by <a href="http://www.mycodes.net/" target="_blank">源码之家</a>
        </footer>
        <!--footer section end-->
</block>